from urllib.request import urlretrieve
from urllib.request import urlopen
from bs4 import BeautifulSoup

html = urlopen("http://www.pythonscraping.com")
bsObj = BeautifulSoup(html)
imageLocaltion = bsObj.find('a', {'id': 'logo'}).find('image')['src']
urlretrieve(imageLocaltion, 'logo.jpg')
